package com.inche.chapter04;

import android.content.ComponentName;
import android.content.Intent;
import android.nfc.Tag;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class ActStartActivity extends AppCompatActivity implements View.OnClickListener {

    private static final String TAG = "ActStartActivitySjm";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_act_start);
        Button btn_jump =  findViewById(R.id.btn_jump);
        btn_jump.setOnClickListener(this);
        Log.d(TAG, "onCreate: ");
    }

    @Override
    public void onClick(View v) {
//        1.在Intent的构造函数中指定
//        startActivity(new Intent(this, ActFinshActivity.class));

//        2.调用意图对象的setClass方法指定
//        Intent intent = new Intent(this, ActFinshActivity.class);
//        startActivity(intent);

        Intent intent = new Intent();
        ComponentName component = new ComponentName(this,ActFinshActivity.class);
        new ComponentName("","");
        intent.setComponent(component);
        startActivity(intent);

    }

    @Override
    protected void onStart(){
        super.onStart();
        Log.d(TAG, "onStart: ");
    }

    @Override
    protected void onResume(){
        super.onResume();
        Log.d(TAG, "onResume: ");
    }

    @Override
    protected void onPause(){
        super.onPause();
        Log.d(TAG, "onPause ");
    }

    @Override
    protected void onStop(){
        super.onStop();
        Log.d(TAG, "onStop ");
    }


    @Override
    protected void  onDestroy(){
        super.onDestroy();
        Log.d(TAG, "onDestroy ");
    }
    @Override
    protected void onRestart(){
        super.onRestart();
        Log.d(TAG, "onRestart ");
    }
}